class Solution(object):
    def firstUniqChar(self, s):
        """
        :type s: str
        :rtype: int
        """
        iDict = {}
        for i,c in enumerate(s):
            if c not in iDict:
                iDict[c]=i
            else:
                iDict[c]=None
        ret = [i for i in iDict.values() if i!=None]
        return min(ret) if ret else -1